<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.min.js"></script>
  <div class="app">
    <div> {{n}}</div>
    <button @click="n++">按钮</button>
    <div v-show="flag">我是一个盒子</div>
    <button @click="tyy">点我控制盒子隐藏与显示</button>
  </div>
  <script>
    const app = new Vue({
      el: '.app',
      data: {
        n: 5,
        flag:true
      },
      methods:{
        btn(m){
         console.log(this.n);
         this.n += x
        },
        tyy(){
         this.flag = !this.flag
        }
      }

    })
  </script>
</body>

</html>